package day1125;

import java.util.Arrays;

public class Demo7 {
    public static void main(String[] args) {
        int[]   ar=new int[]{3,5, 8};
        //                     {3,5}
        int[]   as=Arrays.copyOf( ar , 2);

        String[]   ss={"赵丽", "刘康","卫欢","黎藜"};
        String[]   st=Arrays.copyOf(ss, 3);


        String[]   s1={"赵丽", "刘康","卫欢","黎藜"};
        System.out.println(s1);

        s1=Arrays.copyOf(s1, 3);
        System.out.println(s1.length);

        //a={ 5,9 ,3 }    ---->     a={5}
        int[]  a={5,9,3};
        //复制数组的第一个元素
        a=Arrays.copyOf(a ,1);
        System.out.println(a[2]);
        //数组下标越界


    }

}